/**
 * Copyright(c) ${copyrightYear} ${company}
 * All rights reserved.
 * Created on ${date}
 */
package ${package};


import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import ${package}.util.LogUtil;
import ${package}.util.ProjectUtil;

/**
 * spring加载之后的监听器
 * 
 * @author CloudKing
 * 
 */
public class PostSpringListener implements ServletContextListener {
    /**
     * 上下文销毁
     */
    public void contextDestroyed(ServletContextEvent arg0) {
    }

    /**
     * 上下文初始化
     */
    public void contextInitialized(ServletContextEvent event) {
        try {
            ProjectUtil.initSpringContext(event.getServletContext());
            AuthorityInterceptor.initRightsUrl();
            triggerQuartz();
        } catch (Exception e) {
            LogUtil.error(e);
        }
    }


    /**
     * 触发quartz
     * 
     * @throws Exception
     *             所有异常
     */
    private void triggerQuartz() throws Exception {
//        StdScheduler stdScheduler = (StdScheduler) ProjectUtil.getSpringBean("schedulerFactory");
//        stdScheduler.start();
    }

}
